<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>


<body>

圆的半径：<input type="text" id="r" value=""><br>
圆的周长：<input type="text" id="zc" value=""><br>
圆的面积：<input type="text" id="mj" value="">
</body>
</html>
<script>
    var r,z,s;
    var r = prompt("请输入半径");
    var n = parseInt(r);
    if(isNaN(n)){
        alert('请输入数值！')
    }else{
        const PI = 3.14;
        s = Math.PI*r*r;
        document.write("圆的面积是："+s);

        z = Math.PI * 2 * r;
        document.write("圆的周长是："+z);

        document.getElementById("r").value= n;
        document.getElementById("zc").value= z;
        document.getElementById("mj").value= s;
    }
</script>